cc.FadeOutWithChildren = cc.FadeOut.extend(/** @lends cc.FadeOut# */{
    /**
     * @param {Number} time  time in seconds
     */
    update:function (time) {
        this._target.setOpacity(255 * (1 - time));
        for(var i in this._target.getChildren()){
            var child = this._target.getChildren()[i];
            child.setOpacity(255*(1 - time));
        }
    },

    /**
     * @return {cc.ActionInterval}
     */
    reverse:function () {
        return cc.FadeInWithChildren.create(this._duration);
    },
});


cc.FadeOutWithChildren.create = function (duration) {
    var action = new cc.FadeOutWithChildren();
    action.initWithDuration(duration);
    return action;
};


cc.FadeInWithChildren = cc.FadeOut.extend(/** @lends cc.FadeOut# */{
    /**
     * @param {Number} time  time in seconds
     */
    update:function (time) {
        this._target.setOpacity(255 * time);
        for(var i in this._target.getChildren()){
            var child = this._target.getChildren()[i];
            child.setOpacity(255*time);
        }
    },

    /**
     * @return {cc.ActionInterval}
     */
    reverse:function () {
        return cc.FadeOutWithChildren.create(this._duration);
    },
});

cc.FadeInWithChildren.create = function (duration) {
    var action = new cc.FadeInWithChildren();
    action.initWithDuration(duration);
    return action;
};
